package com.liam.product.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: LiamLMK
 * @CreateTime: 2025-03-13
 * @Description:
 * @Version: 1.0
 */

@RefreshScope // 配置热更新注解
@RestController
public class NacosController {

    @Value("${nacos.config}") // 实时获取
    private String nacosConfig;

    @RequestMapping("/getConfig")
    public String getConfig() {
        return "从Nacos获取配置项nacosConfig:" + nacosConfig;
    }

}
